package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author huanmo
 * @since 2025-09-18
 */
@RestController
@RequestMapping("/admin/replies")
@RequiredArgsConstructor
@Api(tags = "管理端-评论相关接口")
public class InteractionReplyAdminController {

    private final IInteractionReplyService replyService;

    @GetMapping("/page")
    @ApiOperation("管理端分页查询回答或评论列表")
    public PageDTO<ReplyVO> queryReplyPageAdmin(ReplyPageQuery query){
        return replyService.queryReplyPageAdmin(query);
    }

    @PutMapping("/{id}/hidden/{hidden}")
    @ApiOperation("管理端显示或隐藏评论")
    public void isHidden(@PathVariable("id") long id, @PathVariable("hidden") boolean hidden) {
        replyService.isHidden(id, hidden);
    }
}
